Build/Test Tools: Expand visual regression test coverage for admin pages.#10914
Build/Test Tools: Expand visual regression test coverage for admin pages.#10914josephfusco wants to merge 3 commits intoWordPress:trunkfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
83cbdcd to
014f376
Compare
b741ba1 to
fff0a92
Compare
c537f84 to
c26d870
Compare
9a7848f to
18d19f8
Compare
Normalize volatile UI for visual tests and reorganize snapshot suites. Switch admin notices from visibility:hidden to display:none to avoid layout shifts across runs, and hide block-editor modals. In tests, blur any focused element on page ready to avoid focus-ring diffs; group pages into section-based describe blocks for a nested report; update and add mask selectors (use .editor-visual-editor for block editor); warn when a mask selector matches no elements; and preserve per-test setup/teardown behavior. These changes reduce flaky diffs and make the HTML report easier to navigate.
e59ea20 to
f75de1f
Compare
Summary
Expands admin visual regression coverage from 22 to 37 screenshots ahead of the 7.0 admin reskin.
Replaces 22 hand-written tests with a data-driven
pagesarray and a single test loop. Volatile elements are stabilised in two layers: a globalscreenshot.css(injected at capture time via Playwright'sstylePath) and per-page mask selectors.Key changes (3 files):
screenshot.css(new) — hides volatile elements (dates, gravatars, notices, version strings, block editor modals) globally; usesvisibility: hiddento preserve layout, except notices and modals which usedisplay: nonesince they may not exist in the DOM between runsplaywright.config.js— adds HTML reporter, full-page capture, 1 % diff tolerance, animation disabling, and single-worker CI serialisationvisual-snapshots.test.js— data-driven test loop withsection-basedtest.describenesting for grouped HTML reports,setup/teardownlifecycle via REST API, per-page masks, and awaitForPageReadyhelper for network/font/jQuery/focus settlingPages covered
Testing
Diff images land in
artifacts/; an HTML report opens automatically.Trac ticket
https://core.trac.wordpress.org/ticket/62671